package org.dicr.traffic.aggregator;

import java.util.*;

import org.dicr.traffic.source.*;

/**
 * Traffic Aggregator.
 * 
 * @author dicr <A href='http://dicr.org'>Igor A Tarasov</A>
 * @version 060703
 */
public interface TrafficAggregator extends TrafficSource {
	/**
     * Set buffer size.
     * 
     * @param size new buffer size
     */
	public void setBufferSize(int size);

	/**
     * Return buffer size.
     * 
     * @return current buffer size
     */
	public int getBufferSize();

	/**
     * Add source to aggregator.
     * 
     * @param source the source, from which traffic will be integrated
     */
	public void addSource(TrafficSource source);

	/**
     * Remove source
     * 
     * @param source source, which will removed from traffic aggregation
     */
	public void removeSource(TrafficSource source);

	/**
     * Set sources to collect traffic from. Previous sources are discarded.
     * 
     * @param sources sources to use in traffic aggregation.
     */
	public void setSources(Collection<TrafficSource> sources);

	/**
     * Return sources
     * 
     * @return sources, from which traffic is aggregated
     */
	public Collection<TrafficSource> getSources();

	/**
     * Return time of first packet.
     * 
     * @return time in milliseconds of first aggregated packet or 0 if no packets
     */
//	public long getFirstTime();

	/**
     * Return time of last packet.
     * 
     * @return time in milliseconds of last aggregated packet or 0 if no packets.
     */
//	public long getLastTime();
}
